<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id = "app">
        <span v-if="show">
            <label for="username">用户名</label>
            <!-- key的作用就是防止复用 -->
            <input type="text" id="username" placeholder = "用户名" key="username">
        </span>
        <span v-else="show = !show">
            <label for="email">用户邮箱</label>
            <input type="text" id="email" placeholder="用户邮箱" key="email">
        </span>
        <button @click="show = !show">切换登录方式</button>
       
    

    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
    <script>
        var app = new Vue({
            el: '#app',
            data: {
                message: 'Hello Vue!',
                show:true,
            },
            methods:{
              
               

            }
        })

    </script>
</body>

</html>